<ts-datepicker #datepicker="tsDatepicker" [(ngModel)]="date" [color]="global.params.color"></ts-datepicker>
<div class="toolbar">
    <h4>{{inventory.id===0?'添加库存':'库存详情'}}</h4>
</div>
<div class="p-2">
    <div class="card card-body">
        <form #ngForm="ngForm" class="container m-0">
            <div class="form-group row">
                <label class="col-sm-2 col-form-label label-required text-right">期初单号</label>
                <div class="col-sm-10">
                    <input required name="name" #companyName="ngModel" [class.is-invalid]="companyName.invalid&&!companyName.pristine" [(ngModel)]="inventory.companyName"
                        type="text" class="form-control" placeholder="请输入期初单号">
                    <div class="invalid-feedback">期初单号是必填的</div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">仓库名称</label>
                <div class="col-sm-10">
                    <div class="row">
                        <div class="col">
                            <input name="mobile" [(ngModel)]="inventory.companyManagerMobile" type="text" class="form-control" placeholder="请输入仓库名称">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">期初日期</label>
                <div class="col-sm-10">
                    <input [value]="date" tsToggle [target]="datepicker" [bind]="datepicker" type="text" class="form-control bg-white pointer"
                        placeholder="请选择日期" readonly>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">商品品种数</label>
                <div class="col-sm-10">
                    <div class="row">
                        <div class="col">
                            <input name="mobile" [(ngModel)]="inventory.companyManagerMobile" type="text" class="form-control" placeholder="请输入商品品种数">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">商品总箱数</label>
                <div class="col-sm-10">
                    <div class="row">
                        <div class="col">
                            <input name="mobile" [(ngModel)]="inventory.companyManagerMobile" type="text" class="form-control" placeholder="请输入商品总箱数">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">商品总金额</label>
                <div class="col-sm-10">
                    <div class="row">
                        <div class="col">
                            <input name="mobile" [(ngModel)]="inventory.companyManagerMobile" type="text" class="form-control" placeholder="请输入商品总金额">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">录入人</label>
                <div class="col-sm-10">
                    <div class="row">
                        <div class="col">
                            <input name="mobile" [(ngModel)]="inventory.companyManagerMobile" type="text" class="form-control" placeholder="请输入录入人">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">审核人 </label>
                <div class="col-sm-10">
                    <div class="row">
                        <div class="col">
                            <input name="mobile" [(ngModel)]="inventory.companyManagerMobile" type="text" class="form-control" placeholder="请输入审核人">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label"></label>
                <div class="col-sm-10 m-btn">
                    <button tsBtn routerLink="/inventory/inventory">取消/返回</button>
                    <button [disabled]="ngForm.form.invalid" *ngIf="inventory.id===0" tsBtn loading (submit)="confirmInsert($event)" color="success">确认添加</button>
                    <button [disabled]="ngForm.form.invalid" *ngIf="inventory.id!==0" tsBtn loading (submit)="confirmUpdate($event)" color="primary">确认修改</button>
                </div>
            </div>
            <!--表单测试数据-->
            <!-- <pre>{{company|json}}</pre> -->
        </form>
    </div>
</div>